Add Requesty as an LLM provider - #49
Conversation
Wires Requesty (OpenAI-compatible router) through the same code paths as OpenRouter: provider registry entry, keychain-backed API key, model catalog fetch from /v1/models, settings section, fallback chain, tools view and new tab model pickers. Requires APIProvider.requesty from AgentTools.
|
CI note: the only compile error in the macOS run is |
|
FYI to those porting their own "OpenRouter / Requesty LLM Providers": We recently consolidated the LLM Provider code to make it easier to port a new provider within agent. The latest provider that was added is Requesty and is similar to OpenRouter. Requesty will be easier to follow and OpenRouter comments are referenced in more places. We also moved APIProvider.swift from AgentTools Swift package to the Agent project. This should cut down file editing to only 4 files: ModelFetching.swift These changes have been applied to Requesty which will be in our next official build. |
|
Your PR changes are in this pre-release: https://github.com/AgentiLoop/Agent/releases/tag/v1.1.37.237 @Thibaultjaigu We also refactored the app to make adding future LLM Providers easier. |
Summary
Re-adds Requesty as an LLM provider, this time wired through every code path a provider needs, following the shape of the OpenRouter and MiniMax integrations.
Depends on AgentiLoop/AgentTools#2, which adds
APIProvider.requesty. The Xcode project pins AgentTools to the1.0.0 ..< 10.0.0range, so once that lands and a tag is cut this builds without further changes here.Context
#25 added Requesty but, as the removal noted, the implementation was never completed: no keychain entry, no model catalog fetch, no settings section, no fallback chain or tools view support. This PR does all of that. Nothing from the old attempt is reused.
Requesty is an OpenAI-compatible router (
https://router.requesty.ai/v1), so requests go through the existingOpenAICompatibleServicepath via the registry, exactly like MiniMax. No new service type.Changes
Swift (12 files, all pre-existing since
project.pbxprojlists sources explicitly):Services/LLMProviderSetup.swift:requestyLLMProviderConfig(.cloudAPI,.openAIprotocol, chat and models URLs, streaming/tools/vision/systemPrompt) registered afteropenRouter.Services/KeychainService.swift:case requesty = "com.agent.requesty-api-key".AgentViewModel/Core/AgentViewModel.swift:requestyAPIKey(keychain backed),requestyModel(UserDefaults),requestyModels,isFetchingRequestyModels.AgentViewModel/Features/ModelFetching.swift:fetchRequestyModels()and a catalog fetcher forGET /v1/modelsthat keeps entries with a nonzerocontext_windowandsupports_tool_calling == true(the loop is tool driven). Ids are alreadyprovider/model, so the id is used as the display name.AgentViewModel/TaskExecution/Setup.swift:.requestyarm inresolveProviderAndModel(model name and vision detection); service construction falls through to the existing OpenAI-compatible default.AgentViewModel/Core/Colors.swift,AgentViewModel/Messages/Compression.swift,AgentViewModel/Features/ScriptTabs.swift: temperature, context window and global model / API key / display name arms, matching OpenRouter.Views/Settings/SettingsView.swift: Requesty section withLockedSecureFieldAPI key, model text field or picker, and refresh button.Views/Settings/FallbackChainView.swift,Views/Tabs/NewMainTabSheet.swift,Views/Tools/ToolsView.swift: model option and default model arms.Docs: the five READMEs go from 18 to 19 providers and gain a Requesty row after OpenRouter.
Intentionally not touched: the
OpenRouterProtocol/ Anthropic protocol switch (OpenRouter only), the OpenRouter free tier 429 handling inErrorHandler.swift, default fallback chains, judge or auto selection lists (OpenRouter is in none of them).Verification
case .foundationModelarm has matching.openRouterand.requestycounts; the remainingswitch providersites havedefault:. Compiling AgentTools from the Add Requesty to APIProvider AgentTools#2 branch and typechecking the changed files against it produced no "switch must be exhaustive" errors, and a control switch that omitted.requestydid fail withadd missing case: '.requesty'.GET https://router.requesty.ai/v1/modelsreturns 200 (with or without a key), 725 entries, 694 withsupports_tool_calling, all with a nonzerocontext_window.xcodebuildon this machine (no macOS 26 SDK), so please give it one build in Xcode with AgentTools bumped to a tag containing.requesty.Disclosure: I work at Requesty. Happy to adjust anything to match project conventions.